
<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
    <meta name="generator" content="Hugo 0.84.0">
    <title>登录</title>

    

    <!-- Bootstrap core CSS -->
<link href="public/static/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- Favicons -->
<!-- <link rel="apple-touch-icon" href="/docs/5.0/assets/img/favicons/apple-touch-icon.png" sizes="180x180"> -->
<!-- <link rel="icon" href="/docs/5.0/assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png"> -->
<!-- <link rel="icon" href="/docs/5.0/assets/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png"> -->
<!-- <link rel="manifest" href="/docs/5.0/assets/img/favicons/manifest.json"> -->
<!-- <link rel="mask-icon" href="/docs/5.0/assets/img/favicons/safari-pinned-tab.svg" color="#7952b3"> -->
<!-- <link rel="icon" href="/docs/5.0/assets/img/favicons/favicon.ico"> -->
<!-- <meta name="theme-color" content="#7952b3"> -->


    <style>
      .bd-placeholder-img {
        font-size: 1.125rem;
        text-anchor: middle;
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
      }

      @media (min-width: 768px) {
        .bd-placeholder-img-lg {
          font-size: 3.5rem;
        }
      }
    </style>

    
    <!-- Custom styles for this template -->
    <link href="public/static/app/admin/login/css/signin.css" rel="stylesheet">
    <script type="text/javascript" src="public/static/node_modules/jquery/dist/jquery.min.js"></script>
    <script type="text/javascript" src="public/static/node_modules/layer-src/dist/layer.js"></script>
    <script type="text/javascript">
      var myloading = layer.msg('加载中', {
        icon: 16
        ,shade: 0.01
        ,time: false
      });

      window.setInterval(function () {
        if (window.document.readyState == "complete") { 
          layer.close(myloading);
        } 
      }, 700);
    </script>
  </head>
  <body class="text-center">
    
<main class="form-signin">
  <form id="login-form">
    <!-- <img class="mb-4" src="/docs/5.0/assets/brand/bootstrap-logo.svg" alt="" width="72" height="57"> -->
    <h1 class="h3 mb-3 fw-normal">后台登录</h1>

    <div class="form-floating">
      <input type="text" class="form-control" id="username" placeholder="手机号" required value="admin">
      <label for="username">手机号</label>
    </div>
    <div class="form-floating">
      <input type="password" class="form-control" id="password" placeholder="密码" required value="123456">
      <label for="password">密码</label>
    </div>

    <!-- <div class="checkbox mb-3">
      <label>
        <input type="checkbox" value="remember-me"> Remember me
      </label>
    </div> -->
    <button class="w-100 btn btn-lg btn-primary" type="button" id="submit-login">登录</button>
    <p class="mt-5 mb-3 text-muted">&copy; 2021</p>
  </form>
</main>

<script type="text/javascript">
    $(document).ready(function() {
        $('#submit-login').click(function(event) {
            /* Act on the event */
            var field = {
                username: $('#username').val(),
                password: $('#password').val(),
            };
            if (field.username == '') {
                layer.msg('手机号不能为空！');
                return false;
            }
            if (field.password == '') {
                layer.msg('密码不能为空！');
                return false;
            }
            $.post('?m=admin&c=Login&a=login', field, function(data, textStatus, xhr) {
                // console.log(data);
                if (data.code==200) {
                    layer.msg(data.msg, function () {
                        window.location = data.data.home_page;
                    });
                }else{
                    layer.msg(data.msg);
                }
            }, 'json');
        });
    });
</script>
    
  </body>
</html>